home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / utils / init / enbl.c next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  579 b   |  31 lines

  1. /*
  2.  * enbl.c --
  3.  *    POSTGRES module enable and disable support code.
  4.  */
  5.  
  6. #include "tmp/c.h"
  7.  
  8. RcsId("$Header: /private/postgres/src/utils/init/RCS/enbl.c,v 1.3 1990/09/25 16:52:55 kemnitz Exp $");
  9.  
  10. #include "utils/module.h"
  11.  
  12. bool
  13. BypassEnable(enableCountInOutP, on)
  14.     Count    *enableCountInOutP;
  15.     bool    on;
  16. {
  17.     AssertArg(PointerIsValid(enableCountInOutP));
  18.     AssertArg(BoolIsValid(on));
  19.  
  20.     if (on) {
  21.         *enableCountInOutP += 1;
  22.         return ((bool)(*enableCountInOutP >= 2));
  23.     }
  24.  
  25.     AssertState(*enableCountInOutP >= 1);
  26.  
  27.     *enableCountInOutP -= 1;
  28.  
  29.     return ((bool)(*enableCountInOutP >= 1));
  30. }
  31.